#include "zipstream.h"
#include <iostream>
#include <sstream>
#include <math.h>

using namespace std;
using namespace zlib_stream;

class dummy
{
public:
	dummy(float f_ = 3.14f, int i_= 1) : f(f_), i(i_)
	{};
	void reset(){f=0.0;i=0;};

	friend ostream& operator << ( ostream& out, dummy const& d)
	{
		out<<" "<<d.f<<" "<<d.i;
		return out;
	}
	friend istream& operator >> ( istream& in, dummy& d)
	{
		in>>d.f>>d.i;
		return in;
	}

	friend wostream& operator << ( wostream& out, dummy const& d)
	{
		out<<L" "<<d.f<<L" "<<d.i;
		return out;
	}
	friend wistream& operator >> ( wistream& in, dummy& d)
	{
		in>>d.f>>d.i;
		return in;
	}
protected:
	float f;
	int i;
};


int
main()
{
	ostringstream output_buffer;
	// writing data
	output_buffer<<"this is normal output : "<<"Hello world"<<endl;
	cout<<output_buffer.str();
	// zip_ostream uses output_buffer as output buffer :)
	ostringstream o_buffer;
	zip_ostream zipper( o_buffer );

	// writing data as usual
	zipper<<"Hello world"<<endl;
	cout<<"this is zipper output : "<<o_buffer.str()<<endl;

	istringstream i_buf;
	zip_istream izip(i_buf);
}
